package com.yzy.yzy_crm.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yzy.yzy_crm.entity.User;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.HashMap;
import java.util.Map;

@Controller
public class PageController {
    /*
     * 用户名
     * */
    @RequestMapping("/index")
    public String index(Model model){
        Subject subject = SecurityUtils.getSubject();
        User user= (User) subject.getPrincipals().getPrimaryPrincipal();
        model.addAttribute("username",user.getUserName());
        return "index";
    }
    @RequestMapping("/403")
    public String erro(){
        return "403";
    }

    @RequestMapping("/upda")
    public String upda(){
        return "update";
    }

    @RequestMapping("/logout")
    public String logout(){
        return "login.html";
    }
}
